package model;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.concurrent.Callable;

//all information about one user request
public abstract class Request implements Callable<Integer> {
	
	/**
	 * constructor
	 */
	public Request(){}
	
	//convert bytes to file
	protected File convByteToFile(byte[] bytes, String fileId)
	{	
	    File newFile = new File(".\\files\\"+fileId);
	    FileOutputStream fos = null;
	    
		 try {
			 fos = new FileOutputStream(newFile);
			 fos.write(bytes);
			 fos.flush();
			 fos.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}      
	    
	    return newFile;
	}	

}
